package sctu.edu.java.year2016.team03.maoyuhao.day20160524.chapter7_2;

/**
 * 尝试编写一个矩形类，将长宽作为类的属性，在构造方法中将长、宽初始化，定义一个成员方法求此矩形的面积。
 * Created by cc on 2016/5/24.
 */
public class Work {
    int length;
    int wide;
    public Work(int newlength,int newwide){
        length=newlength;
        wide=newwide;
    }

    public void area() {
        int area;
        area=length*wide;
        System.out.println("矩形面积为"+area);
    }
}
